package com.yeqifu.bus.controller;

import com.yeqifu.bus.service.ISalesService;
import com.yeqifu.sys.common.DataGridView;
import com.yeqifu.sys.common.ResultObj;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.math.BigDecimal;

/**
 * @author by Mr. Li
 * @date 2020/4/3 13:43
 */
@Controller
@RequestMapping("amount")
public class AmountController {

    @Autowired
    private ISalesService iSalesService;


    @GetMapping("/getAmount")
    public String getAmount() {
        return "/business/amount/amountManager";
    }

    @GetMapping("/getToInportAmount")
    public String getToInportAmount() {
        return "/business/amount/toInportAmountManager";
    }


    @GetMapping("/showInportAmount")
    @ResponseBody
    public DataGridView showInportAmount() {
        Float aFloat =  iSalesService.getInportAmount();
        DataGridView dataGridView = new DataGridView(aFloat);

        return dataGridView;
    }

    /**
     * 获取 所有的 销售商品的总金额
     *
     * @return
     */
    @GetMapping("/showAmount")
    @ResponseBody
    public DataGridView showAmount() {
        Float amount = iSalesService.getAmount();
        return new DataGridView(amount);
    }
}

